import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a1227
 * Date: 2022-08-30
 * Time: 16:49
 */
public class TextDemo {
    /**
     * 班级成绩输入输出-https://www.nowcoder.com/practice/60d96b08e1cb42e38629d54e37eac008?tpId=290&tqId=618630&ru=/exam/oj&qru=/ta/beginner-programmers/question-ranking&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3D%25E8%25AF%25AD%25E6%25B3%2595%25E7%25AF%2587%26topicId%3D290
     * @param args
     */
    public static void main(String [] args){
        double [][] ary = new double[5][5];
        double [] sum = new double[5];
        sum[0] = 0.0;
        Scanner scan = new Scanner(System.in);
        for(int i = 0; i < ary.length; i++){
            for(int j = 0; j < ary[i].length; j++){
                ary[i][j] = scan.nextDouble();
                sum[i] += ary[i][j];
            }
        }
        for(int i = 0; i < ary.length; i++){
            for(int j = 0; j < ary[i].length; j++){
                System.out.printf("%.1f ",ary[i][j]);//输出double类型的变量用%f
            }
            System.out.printf("%.1f\n",sum[i]);
        }
    }
}
